﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization;

namespace GearOptimizer.ExtensionMethods
{
    public static class CopyExtensions
    {
        public static T DeepCopy<T>(this T source)
        {
            var serializedObject = source.ToBson();
            return BsonSerializer.Deserialize<T>(serializedObject);
        }
    }
}